/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Figures;

import java.awt.Point;
import java.util.ArrayList;
import MyEngine.Neural;



/**
 *
 * @author Macias
 */
public class Figures {
    boolean isWhite;
    Point location;   //it's actual location on board
//    ArrayList<Point> movesVec; // what moves can it make in theory treated as a vector
    static int check;

    public ArrayList<Point> checkPossibleMoves(char[][] board){

        return null;
    }
     public int getType(){
         return 0;
    }
     public int getPosX(){
         return location.x;
     }

     public int getPosY(){
         return location.y;
     }


     public boolean isChecked (char [][] board, Point move){

         Neural neu = new Neural(true);

       char[][] tmpBoard = new char[8][8];
        for(int c = 0;c<=7; c++)
            for(int r = 0;r<=7; r++)tmpBoard[c][r]=board[c][r];
        char figureType = board[location.x][location.y];
        tmpBoard[location.x][location.y] = 0;
        tmpBoard[move.x][move.y]=figureType;
        
        check = neu.isChecked(tmpBoard,true);

        if(isWhite){
            if(check==-100 || check ==-1000) return true;
        }
        else{
            if(check==100 || check ==1000) return true;
        }

         return false;
     }

}
//public class Figures {
//    int posx , posy;   //it's actual location on board
//    ArrayList<Point> movesVec; // what moves can it make in theory treated as a vector
//
//
//    public int[][] checkPossibleMoves(char[][] board){
//
//        return null;
//    }
//     public boolean getColor(char[][] dana)
//    {
//        return Character.isUpperCase(dana[posx-1][posy-1]);
//    }
//
//    public int getPosX()
//    {
//        return this.posx;
//    }
//
//    public int getPosY()
//    {
//        return this.posy;
//    }
//}
